package com.jlcindia.hibernate;

import org.hibernate.*;
public class Lab38 
{
	public static void main(String args[])
	{
		Transaction tx=null;
		try
		{
			SessionFactory sf=HibernateUtil.getSessionFactory();
			Session session=sf.openSession();
			tx=session.beginTransaction();
			Student student = new Student("vaas", "vas@jlc", "9999");
			session.save(student);
			tx.commit();
			session.close();
		}
		catch (Exception e) 
		{
			e.printStackTrace();
			if(tx!=null)
				tx.rollback();
		}
	}
}
